#!/bin/sh

#desc:Cameras management
#package:odvideo
#type:local

# Copyright(c) 2011 OpenDomo Services SL. Licensed under GPL v3 or later
# Isidro Catalan <skarvin@gmail.com>

# Common video module vars
if ! test -f "/etc/opendomo/videoConfVars.conf"; then
   cp /etc/opendomo/videoConfVars.conf.orig /etc/opendomo/videoConfVars.conf
fi
. "/etc/opendomo/videoConfVars.conf"

# Lib config
. "$LIB_CONFIG"
# ----------------------------------------------------------------------------
# desc: List all cameras url stream
# author: Isidro Catalan <skarvin@gmail.com>, http://www.opendomo.com
# date: December 2009
#
# CHANGES:
# ----------------------------------------------------------------------------



for conf_file in `ls $MTN_CNF_PATH/odcam-*.conf 2>/dev/null | sort`; do
	CONF_FILE="$conf_file"
	cam_name=`getValue "text_left"`
	port=`getValue "webcam_port"`
	netcam_url=`getValue "netcam_url"`
	
	if [ "$netcam_url" != "" ]; then
		echo -e "ipcam http://$DOMAIN:$port $cam_name"
	else
		echo -e "usbcam http://$DOMAIN:$port $cam_name"
	fi
		

done

